<%--
  Created by IntelliJ IDEA.
  User: zll
  Date: 2018/5/30
  Time: 12:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <title>签到列表</title>

    <jsp:include page="../comm/comm.jsp"/>
</head>
<body>
<div class="layui-form" action="">
</div>
<table id="demo" lay-filter="test"></table>


<script type="text/html" id="operate">
    <button class="layui-btn layui-btn-sm" onclick="modify('{{d.id}}')">详情</button>
</script>


<script>
    var openid=getQueryString("openid");
    var activityId=getQueryString("activityId");
    function modify(id){
         location.href="/tasks/modify?id="+id+"&type="+type;
    }
    layui.use('table', function(){

        var table = layui.table;

        //第一个实例
        table.render({
            elem: '#demo'
            ,url: '/role/listUserSign?openid='+openid+"&activityId="+activityId //数据接口
            ,page: true //开启分页
            ,limits:[10]
            ,response: {
                statusName: 'status' //数据状态的字段名称，默认：code
                ,statusCode: 200 //成功的状态码，默认：0
                ,msgName: 'msg' //状态信息的字段名称，默认：msg
                ,countName: 'msg' //数据总数的字段名称，默认：count
                ,dataName: 'data' //数据列表的字段名称，默认：data
            }
            ,cols: [[ //表头
                {field: 'nickname', title: '姓名'},
                {field: 'num', title: '连续签到次数'},
                {field: 'createTime', title: '签到时间',templet: '#date'},
            ]]
        });
        $("#add").click(function () {
            if(type=="1")
                location.href="/page/dzhd/uptoupiao";
            else
            location.href="/page/dzhd/updz";
        });


    });
    function getQueryString(name)
    {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return null;
    }
</script>
</body>
</html>
